package com.wanxing.sellerapp.seller;

import android.content.Context;

import com.wanxing.sellerapp.seller.sdk.ISeller;
import com.wanxing.sellerapp.seller.sdk.video.BaoJianVideoSeller;
import com.wanxing.sellerapp.seller.sdk.video.VideoSellerCallback;

import org.jetbrains.annotations.NotNull;

/**
 * 该类所有操作(包含回调函数)均发生在 WorkThread,
 */
public class SellerManager implements ISellerManager{

    private ISeller seller;

    @Override
    public void open(
            Context context,
            @NotNull ISellerEventCallback callback,
            @NotNull VideoSellerCallback videoSellerCallback) {

        BaoJianVideoSeller baoJianVideoSeller = new BaoJianVideoSeller(context);
        baoJianVideoSeller.init(videoSellerCallback);
        seller = baoJianVideoSeller;
    }

    @Override
    public void close() {
        seller.release();
    }

    @Override
    public ISeller getSeller() {
        return seller;
    }

    @Override
    public boolean canOpen() {

        return false;
    }
}
